Script functions:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detect if a <waggon1> tows another waggon: 
  ? <waggon1> call AEF_IsTowing : hint "waggon1 is towing an other waggon!"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detect if a <waggon1> is towed by another waggon: 
  ? <waggon1> call AEF_IsAttached : hint "waggon is attached!"
  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detect if a switch is set to "line" (straight):
Two possibilities:

1) pass the object of the switch (e.g. id=21324)

  ? !((object 21324) call AEF_IsSet2Line) : hint "switch is set to curve"

2) put an object (e.g. Game Logic = "SW1") close to the switch

  ? SW1 call AEF_IsSet2Line : hint "switch is set to line"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attach a waggon1 to another waggon2 via script

  [waggon1, waggon2] exec "\AEF_Train\script\Attach.sqs"

attention: be sure that waggon2 doesn't allready tow one! Use scripts above.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detach a waggon1 from another

  AEFDetachWaggon = waggon1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Activate auto-transport script for the stakes waggon:

put the following line into the init field of the desired stakes waggon:

  this exec "\AEF_Train\script\transport.sqs"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Load stake wagon with (only static) cars, trucks or goods

start script with:
[wagonname,"type",amount of randomly goods,(optional)free cargo seatpositions] exec "\AEF_Train\script\RWcargo.sqs

possible type's can be:
"UST" - USTruck (it can be only one Truck and up to 6 'seats' on the side)
"GT"  - Guerillatruck (it can be only one Truck and up to 6 'seats' on the side)
"CT"  - civil truck (it can be only one Truck and up to 6 'seats' on the side) 
"CC"  - civil car (it can be only one Car and up to 2 'seats' on the side or good places)
"C"   - goods only (it can be up to 6 'seats' on the side or good places)

examples:
=========

  [this,"UST",0,2] exec "\AEF_Train\script\RWcargo.sqs"
  fill stake wagon with one randomly choosen US-truck and all possible side seats exept 2 are filled with placeholder

  [this,"C",4,0] exec "\AEF_Train\script\RWcargo.sqs"
  fill stake wagon with 4 randomly choosen goods

  [this,"CC",2,0] exec "\AEF_Train\script\RWcargo.sqs"
  fill stake wagon with one randomly choosen car and 2 randomly choosen goods 









